﻿#ifndef COMMENTMANAGE_H
#define COMMENTMANAGE_H

#include <QWidget>
#include <QDate>
#include "globalvars.h"
#include "replycomment.h"
#include "hoteldetailscommentcontent.h"

namespace Ui {
class CommentManage;
}

class CommentManage : public QWidget
{
    Q_OBJECT
signals:
    void signalSubmitBusComment(const QString &,const QString&);
    void signalRefreshComment(const QString &,const QString &);

public:
    explicit CommentManage(QWidget *parent = nullptr);
    ~CommentManage();

    void setOptionalHotel();
    void judgeDaySelectState();
    void judgeStarSelectState();
    QString getCurrentSelectedHotelID();
    void refrushShow();
    void addListShow(const CommentInfoList::iterator& it);

public slots:
    void slotRelayComment(const QString &commentID);
    void slotSetCommentList(bool result,const QString& msg);
    void slotSubmitBusCommentResult(bool result,const QString& msg);
    void slotSetCommentImage(bool result, const QString& msg, const QImage& image);
    void slotCommentListClean();

private slots:
    void on_cb_selectHotel_currentIndexChanged(const QString &arg1);
    void on_tabWidget_currentChanged(int index);

    void on_pb_comWeek_clicked();
    void on_pb_comMonth_clicked();
    void on_pb_starAll_clicked();
    void on_pb_starMid_clicked();
    void on_pb_starGood_clicked();
    void on_de_comStart_dateChanged(const QDate &date);
    void on_de_comEnd_dateChanged(const QDate &date);

private:
    Ui::CommentManage *ui;

    ReplyComment *m_replyComment;

    bool m_isAll;
    QDate m_startDay;
    QDate m_endDay;
    DaySelect m_daySelect;
    StarSelect m_starSelect;

    QMap<QString,QString> m_hotelIdNameMap;
    QVector<HotelDetailsCommentContent *> m_commentVector;
    CommentInfoList *m_commentListTemp;
};

#endif // COMMENTMANAGE_H
